import json
import logging

import yagmail
import yaml


def set_loc():
    logging.basicConfig(filename='xiachufang.txt',level=logging.DEBUG,format='%(message)s->%(asctime)s->%(filename)s')
def send_mail(filename):
    ya=yagmail.SMTP(user='2580925180@qq.com',password='xacnmejavvcnebhd',host='smtp.qq.com')
    ya.send(to='maqiyun1234@qq.com',subject='下厨房测试报告',contents='今日下厨房测试报告,请查收',attachments=filename)
def yahuoqu(filepthon):
    with open(filepthon,'r+',encoding='utf-8') as f:
        return yaml.safe_load(f)
def jsonhuoqu(filepthon):
    with open(filepthon,'r+',encoding='utf-8') as f:
        return json.detect_encoding(f)